import Vue from 'vue'
import VueRouter from 'vue-router'
import LoginView from '../views/front/LoginView.vue'

Vue.use(VueRouter)

const routes = [
    {
        path: '/',
        component: () => import('../views/HomeView.vue')
    },
    {
        path: '/result',
        component: () => import('../views/front/ResultView.vue')
    },
    {
        path: '/detail',
        component: () => import('../views/front/PhoneDetailView.vue')
    },
    {
        path: '/reg',
        component: () => import('../views/front/RegisterView.vue')
    },
    {
        path: '/order',
        component: () => import('../views/front/UserOrderListView.vue')
    },
    {
        path: '/shoppingCart',
        component: () => import('../views/front/shoppingCartView.vue')
    },
    {
        path: '/login',
        component: LoginView
    },
    {
        path: '/admin',
        component: () => import('../views/AdminLoginView.vue')
    },
    {

        path: '/sys-admin',
        component: () => import('../views/AdminView.vue'),
        children: [
            {
                path: 'temp/admin/add-new', // /sys-admin/temp/admin/add-new
                component: () => import('../views/sys-admin/temp/AdminAddNewView.vue')
            },
            {
                path: 'temp/admin/list', // /sys-admin/temp/admin/list
                component: () => import('../views/sys-admin/temp/AdminListView.vue')
            },
            {
                path: 'temp/brand/add-new',
                component: () => import('../views/sys-admin/temp/BrandAddNewView.vue')
            },
            {
                path: 'temp/brand/list',
                component: () => import('../views/sys-admin/temp/BrandListView.vue')
            },
            {
                path: 'temp/series/add-new',
                component: () => import('../views/sys-admin/temp/SeriesAddNewView.vue')
            },
            {
                path: 'temp/series/list',
                component: () => import('../views/sys-admin/temp/SeriesListView.vue')
            },
            {
                path: 'temp/banner/add-new',
                component: () => import('../views/sys-admin/temp/BannerAddNewView.vue')
            },
            {
                path: 'temp/banner/list',
                component: () => import('../views/sys-admin/temp/BannerListView.vue')
            },
            {
                path: 'temp/detail/add-new',
                component: () => import('../views/sys-admin/temp/DetailAddNewView.vue')
            },
            {
                path: 'temp/detail/list',
                component: () => import('../views/sys-admin/temp/DetailListView.vue')
            },
            {
                path: 'temp/color/add-new',
                component: () => import('../views/sys-admin/temp/ColorAddNewView.vue')
            },
            {
                path: 'temp/color/list',
                component: () => import('../views/sys-admin/temp/ColorListView.vue')
            },
            {
                path: 'temp/order/list',
                component: () => import('../views/sys-admin/temp/OrderListView.vue')
            },
            {
                path: 'temp/phone/add-new',
                component: () => import('../views/sys-admin/temp/PhoneAddNewView.vue')
            },
            {
                path: 'temp/phone/list',
                component: () => import('../views/sys-admin/temp/PhoneListView.vue')
            },
            {
                path: 'temp/user/list',
                component: () => import('../views/sys-admin/temp/UserListView.vue')
            },
        ]
    },
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
